package cn.ztr.ymcc;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Data
@Accessors(chain = true)
@Document(indexName = "ztr",type = "course")
public class CourseDOC {
    @Id
    private Long id;

    /**
     * 课程名称
     */
    @Field(type = FieldType.Text,store = true,index = true,analyzer = "ik_max_word")
    private String name;

    /**
     * 适用人群
     */
    @Field(type = FieldType.Keyword,store = true,index = true)
    private String forUser;

    /**
     * 课程分类
     */
    @Field(type = FieldType.Long,store = true,index = true)
    private Long courseTypeId;

    @Field(type = FieldType.Keyword,store = true,index = true)
    private String courseTypeName;


    /**
     * 课程等级
     */
    @Field(type = FieldType.Keyword,store = true,index = true)
    private String gradeName;
    @Field(type = FieldType.Long,store = true,index = true)
    private Long gradeId;

    /**
     * 课程的开课时间
     */
    @Field(type = FieldType.Long,store = true,index = true)
    private Long startTime;

    /**
     * 课程的节课时间
     */
    @Field(type = FieldType.Long,store = true,index = true)
    private Long endTime;

    /**
     * 封面，云存储地址
     */
    @Field(type = FieldType.Keyword,store = true,index = false)
    private String pic;

    /**
     * 时长，以分钟为单位
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer totalMinute;

    /**
     * 上线时间
     */
    @Field(type = FieldType.Long,store = true,index = true)
    private Long onlineTime;

    /**
     * 章节数
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer chapterCount;

    /**
     * 讲师，逗号分隔多个
     */
    @Field(type = FieldType.Keyword,store = true,index = false)
    private String teacherNames;

    /**
     * 详情
     */
    @Field(type = FieldType.Keyword,store = true,index = false)
    private String description;

    /**
     * 简介
     */
    @Field(type = FieldType.Keyword,store = true,index = false)
    private String intro;

    /**
     * 收费规则：，收费1免费，2收费
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer charge;

    /**
     * 咨询qq
     */
    @Field(type = FieldType.Keyword,store = true,index = false)
    private String qq;

    /**
     * 价格
     */
    @Field(type = FieldType.Double,store = true,index = true)
    private Double price;

    /**
     * 原价
     */
    @Field(type = FieldType.Double,store = true,index = true)
    private Double priceOld;

    /**
     * 有效期：天为单位
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer validDays;

    /**
     * 销量
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer saleCount=0;

    /**
     * 浏览量
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer viewCount=0;

    /**
     * 评论数
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer commentCount=0;

    /**
     * 收藏量
     */
    @Field(type = FieldType.Integer,store = true,index = true)
    private Integer collectCount=0;

}

